﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<UFPC.Models.Order>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Delete
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Delete</h2>

    <h3>Are you sure you want to delete this?</h3>
    <fieldset>
        <legend>Fields</legend>

        <table class="formtable">
            <tr>
                <td class="formfield">Customer :</td>
                <td><%= Html.Encode(Model.Customer.Name) %></td>
            </tr>
            <tr>
                <td class="formfield">Order Date :</td>
                <td><%= Html.Encode(String.Format("{0:D}", Model.OrderDate)) %></td>
            </tr>
            <tr>
                <td colspan="2">
                    <fieldset>
                        <legend>Order Detail</legend>
                        <table>
                            <tr>
                                <th>Product</th>
                                <th>Quantity</th>
                            </tr>
                            <% foreach (var item in Model.OrderDetails) { %>
                                <tr>
                                    <td><%= Html.Encode(item.Products.Name) %></td>
                                    <td><%= Html.Encode(item.Quantity) %></td>
                                </tr>
                            <% } %>
                        </table>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td class="formfield">Comments :</td>
                <td><%= Html.Encode(Model.Comments) %></td>
            </tr>
        </table>
        
    </fieldset>
    <% using (Html.BeginForm()) { %>
        <div class="button">
		    <input type="submit" value="Delete" />
		    <%= Html.ActionLink("Cancel", "Index") %>
        </div>
    <% } %>

</asp:Content>

